//
//  WmcHomeControlAILogoView.swift
//  YPWatermarkCamera
//
//  Created by 赵洋 on 2022/10/14.
//

import UIKit

class WmcHomeControlAILogoView: WmcBaseView {
    // Internal

    override func makeUI() {
        self.isHidden = true

        self.backgroundColor = .wmc_grayH2_323233.withAlphaComponent(0.7)
        self.layer.cornerRadius = 4.0
        self.layer.masksToBounds = true

        addSubview(iconImageView)
        addSubview(textLabel)

        iconImageView.snp.makeConstraints { make in
            make.left.top.bottom.equalTo(0)
            make.width.equalTo(66)
        }

        textLabel.snp.makeConstraints { make in
            make.left.equalTo(iconImageView.snp.right)
            make.top.bottom.right.equalToSuperview()
        }
    }

    func updateModel(_ model: WmcWatermarkDetailModel) {
        switch model.wmId {
        case 80,
             107,
             91:
            textLabel.text = "钢筋数丨拍照后识别"
        case 81,
             106,
             92:
            textLabel.text = "钢管数丨拍照后识别"
        default: break
        }
    }

    // Private

    private lazy var iconImageView: UIImageView = {
        let view = UIImageView(image: "home_ai_watermark_icon".wmc_image)
        return view
    }()

    private lazy var textLabel: UILabel = {
        let label = UILabel.YP.Create(text: "钢筋数丨拍照后识别", font: UIFont.systemFont(ofSize: 16, weight: .medium), color: UIColor.white, alignment: .center)
        return label
    }()
}
